home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-05-03 | 66.7 KB | 2,709 lines |
- Newsgroups: comp.sources.unix
- From: pmiller@bmr.gov.au (Peter Miller)
- Subject: v26i218: cook-1.4 - a file construction tool (like "make"), Part10/11
- Sender: unix-sources-moderator@efficacy.home.vix.com
- Approved: WhoAmI@efficacy.home.vix.com
-
- Submitted-By: pmiller@bmr.gov.au (Peter Miller)
- Posting-Number: Volume 26, Issue 218
- Archive-Name: cook-1.4/part10
-
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then unpack
- # it by saving it into a file and typing "sh file". To overwrite existing
- # files, type "sh file -c". You can also feed this as standard input via
- # unshar, or by typing "sh <file", e.g.. If this archive is complete, you
- # will see the following message at the end:
- # "End of archive 10 (of 11)."
- # Contents: CHANGES cook/cook.c
- # Wrapped by vixie@efficacy.home.vix.com on Tue May 4 01:36:43 1993
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- if test -f 'CHANGES' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'CHANGES'\"
- else
- echo shar: Extracting \"'CHANGES'\" \(33082 characters\)
- sed "s/^X//" >'CHANGES' <<'END_OF_FILE'
- X
- X
- X
- XProject "cook.1.4" Page 1
- XList of Changes Sat Mar 27 23:14:17 1993
- X
- XChange State Description
- X------- ------- -------------
- X 1 completed New release derived from cook.1.3.
- X 2 completed cope with missing files better in c_incl
- X 3 completed inprove failure messages from tests
- X 4 completed getenv name conflict
- X 5 completed more convex improvements
- X 6 completed fix copyright notices
- X 7 completed fix license version
- X 8 completed use _ty suffix, not _t suffix
- X 9 completed add GNU style long option names
- X 10 completed sundry improvements
- X 11 completed ports to more platforms
- X 12 completed improve the manual pages
- X 13 being_ note ConvexOS as a known port
- X integrated
- X
- X
- X
- XProject "cook.1.4", Change 1 Page 1
- XChange Details Sat Mar 27 23:14:19 1993
- X
- XNAME
- X Project "cook.1.4", Delta 1, Change 1.
- X
- XSUMMARY
- X New release derived from cook.1.3.
- X
- XDESCRIPTION
- X New release derived from cook.1.3.
- X
- X This change is exempt from testing. This change is exempt from
- X testing against the baseline.
- X
- XCAUSE
- X This change was caused by internal_enhancement.
- X
- XFILES
- X Type Action Edit File Name
- X ------- ------- ------- -----------
- X source create 1 COPYING
- X source create 1 aux/BUILDING.man
- X source create 1 aux/CHANGES.sh
- X source create 1 aux/Howto.cook
- X source create 1 aux/MANIFEST.sh
- X source create 1 aux/Makefile.awk
- X source create 1 aux/Makefile.sh
- X source create 1 aux/README.man
- X source create 1 aux/patches.sh
- X source create 1 c_incl/cache.c
- X source create 1 c_incl/cache.h
- X source create 1 c_incl/lang_c.c
- X source create 1 c_incl/lang_roff.c
- X source create 1 c_incl/main.c
- X source create 1 c_incl/os.c
- X source create 1 c_incl/os.h
- X source create 1 c_incl/sniff.c
- X source create 1 c_incl/sniff.h
- X source create 1 common/ansi.c
- X source create 1 common/arglex.c
- X source create 1 common/arglex.h
- X source create 1 common/error.c
- X source create 1 common/error.h
- X source create 1 common/help.c
- X source create 1 common/help.h
- X source create 1 common/main.h
- X source create 1 common/mem.c
- X source create 1 common/mem.h
- X source create 1 common/s-v-arg.h
- X source create 1 common/str.c
- X source create 1 common/str.h
- X source create 1 common/trace.c
- X source create 1 common/trace.h
- X source create 1 common/version.c
- X source create 1 common/version.h
- X source create 1 common/word.c
- X source create 1 common/word.h
- X source create 1 conf/ConvexOS-10
- X source create 1 conf/SunOS-4.1.2
- X
- X
- X
- XProject "cook.1.4", Change 1 Page 2
- XChange Details Sat Mar 27 23:14:19 1993
- X
- X Type Action Edit File Name
- X ------- ------- ------- -----------
- X source create 1 conf/SunOS-4.1.3
- X source create 1 conf/SysV-4.0
- X source create 1 conf/dgux-5.4.1
- X source create 1 config
- X source create 1 cook/builtin.c
- X source create 1 cook/builtin.h
- X source create 1 cook/cook.c
- X source create 1 cook/cook.h
- X source create 1 cook/env.c
- X source create 1 cook/env.h
- X source create 1 cook/expr.c
- X source create 1 cook/expr.h
- X source create 1 cook/glob.c
- X source create 1 cook/glob.h
- X source create 1 cook/hashline.h
- X source create 1 cook/hashline.y
- X source create 1 cook/id.c
- X source create 1 cook/id.h
- X source create 1 cook/lex.c
- X source create 1 cook/lex.h
- X source create 1 cook/listing.c
- X source create 1 cook/listing.h
- X source create 1 cook/main.c
- X source create 1 cook/match.c
- X source create 1 cook/match.h
- X source create 1 cook/option.c
- X source create 1 cook/option.h
- X source create 1 cook/os.c
- X source create 1 cook/os.h
- X source create 1 cook/parse.h
- X source create 1 cook/parse.y
- X source create 1 cook/stmt.c
- X source create 1 cook/stmt.h
- X source create 1 cooktime/date.h
- X source create 1 cooktime/date.y
- X source create 1 cooktime/main.c
- X source create 1 doc/builtin
- X source create 1 doc/cmdline
- X source create 1 doc/conditions
- X source create 1 doc/glossary
- X source create 1 doc/history
- X source create 1 doc/how
- X source create 1 doc/intro
- X source create 1 doc/intro.aa
- X source create 1 doc/intro.bb
- X source create 1 doc/language
- X source create 1 doc/match
- X source create 1 doc/option
- X source create 1 doc/refman.t
- X source create 1 doc/system
- X source create 1 doc/variables
- X source create 1 find_libs/main.c
- X source create 1 find_libs/os.c
- X source create 1 find_libs/os.h
- X source create 1 h/float.h
- X
- X
- X
- XProject "cook.1.4", Change 1 Page 3
- XChange Details Sat Mar 27 23:14:19 1993
- X
- X Type Action Edit File Name
- X ------- ------- ------- -----------
- X source create 1 h/limits.h
- X source create 1 h/stdarg.h-min
- X source create 1 h/stddef.h
- X source create 1 h/stdlib.h
- X source create 1 h/string.h
- X source create 1 h/time.h
- X source create 1 lib/as
- X source create 1 lib/bison
- X source create 1 lib/c
- X source create 1 lib/gcc
- X source create 1 lib/home
- X source create 1 lib/lex
- X source create 1 lib/library
- X source create 1 lib/print
- X source create 1 lib/program
- X source create 1 lib/sccs
- X source create 1 lib/text
- X source create 1 lib/usr
- X source create 1 lib/usr.local
- X source create 1 lib/yacc
- X source create 1 lib/yacc_many
- X source create 1 man1/c_incl.1
- X source create 1 man1/cook.1
- X source create 1 man1/cooktime.1
- X source create 1 man1/find_libs.1
- X source create 1 man1/roffpp.1
- X source create 1 roffpp/main.c
- X source create 1 roffpp/preprocess.c
- X source create 1 roffpp/preprocess.h
- X test create 1 test/00/t0001a.sh
- X test create 1 test/00/t0002a.sh
- X test create 1 test/00/t0003a.sh
- X test create 1 test/00/t0004a.sh
- X test create 1 test/00/t0005a.sh
- X test create 1 test/00/t0006a.sh
- X test create 1 test/00/t0007a.sh
- X test create 1 test/00/t0008a.sh
- X test create 1 test/00/t0009a.sh
- X test create 1 test/00/t0010a.sh
- X test create 1 test/00/t0011a.sh
- X test create 1 test/00/t0012a.sh
- X test create 1 test/00/t0013a.sh
- X test create 1 test/00/t0014a.sh
- X test create 1 test/00/t0015a.sh
- X test create 1 test/00/t0016a.sh
- X test create 1 test/00/t0017a.sh
- X test create 1 test/00/t0018a.sh
- X test create 1 test/00/t0019a.sh
- X test create 1 test/00/t0020a.sh
- X test create 1 test/00/t0021a.sh
- X test create 1 test/00/t0022a.sh
- X test create 1 test/00/t0023a.sh
- X test create 1 test/00/t0024a.sh
- X test create 1 test/00/t0025a.sh
- X test create 1 test/00/t0026a.sh
- X
- X
- X
- XProject "cook.1.4", Change 1 Page 4
- XChange Details Sat Mar 27 23:14:19 1993
- X
- X Type Action Edit File Name
- X ------- ------- ------- -----------
- X test create 1 test/00/t0027a.sh
- X test create 1 test/00/t0028a.sh
- X test create 1 test/00/t0029a.sh
- X test create 1 test/00/t0030a.sh
- X test create 1 test/00/t0031a.sh
- X test create 1 test/00/t0032a.sh
- X test create 1 test/00/t0033a.sh
- X test create 1 test/00/t0034a.sh
- X test create 1 test/00/t0035a.sh
- X test create 1 test/00/t0036a.sh
- X test create 1 test/00/t0037a.sh
- X test create 1 test/00/t0038a.sh
- X test create 1 test/00/t0039a.sh
- X test create 1 test/00/t0040a.sh
- X test create 1 test/00/t0041a.sh
- X
- XHISTORY
- X What When Who Comment
- X ------ ------ ----- ---------
- X new_change Thu Jan 7 pmiller
- X 16:27:56 1993 1
- X develop_begin Thu Jan 7 pmiller
- X 16:27:56 1993 1
- X develop_end Thu Jan 7 pmiller
- X 16:27:56 1993 1
- X review_pass Thu Jan 7 pmiller
- X 16:27:56 1993 1
- X integrate_begin Thu Jan 7 pmiller
- X 16:27:56 1993 1
- X integrate_pass Thu Jan 7 pmiller
- X 16:32:29 1993 1
- X
- X
- X
- XProject "cook.1.4", Change 2 Page 1
- XChange Details Sat Mar 27 23:14:20 1993
- X
- XNAME
- X Project "cook.1.4", Delta 2, Change 2.
- X
- XSUMMARY
- X cope with missing files better in c_incl
- X
- XDESCRIPTION
- X cope with missing files better in c_incl
- X
- X This change is exempt from testing. This change is exempt from
- X testing against the baseline.
- X
- XCAUSE
- X This change was caused by internal_bug.
- X
- XFILES
- X Type Action Edit File Name
- X ------- ------- ------- -----------
- X source modify 2 c_incl/sniff.c
- X
- XHISTORY
- X What When Who Comment
- X ------ ------ ----- ---------
- X new_change Thu Jan 14 pmiller
- X 14:32:13 1993
- X develop_begin Thu Jan 14 pmiller Elapsed time: 0.054
- X 14:32:20 1993 days.
- X develop_end Thu Jan 14 pmiller
- X 14:56:35 1993
- X review_pass Thu Jan 14 pmiller
- X 14:56:41 1993
- X integrate_begin Thu Jan 14 pmiller Elapsed time: 0.078
- X 14:57:19 1993 days.
- X integrate_pass Thu Jan 14 pmiller
- X 15:32:31 1993
- X
- X
- X
- XProject "cook.1.4", Change 3 Page 1
- XChange Details Sat Mar 27 23:14:21 1993
- X
- XNAME
- X Project "cook.1.4", Delta 3, Change 3.
- X
- XSUMMARY
- X inprove failure messages from tests
- X
- XDESCRIPTION
- X 1. Tests need to say what failed when they fail.
- X 2. tests should not assume /tmp is not a symlink.
- X
- X My thanks to J. Cazander, Philips Electronic Design & Tools,
- X The Netherlands, for this suggestion.
- X
- X This change is exempt from testing against the baseline.
- X
- XCAUSE
- X This change was caused by external_enhancement.
- X
- XFILES
- X Type Action Edit File Name
- X ------- ------- ------- -----------
- X source modify 2 config
- X test modify 2 test/00/t0001a.sh
- X test modify 2 test/00/t0002a.sh
- X test modify 2 test/00/t0003a.sh
- X test modify 2 test/00/t0004a.sh
- X test modify 2 test/00/t0005a.sh
- X test modify 2 test/00/t0006a.sh
- X test modify 2 test/00/t0007a.sh
- X test modify 2 test/00/t0008a.sh
- X test modify 2 test/00/t0009a.sh
- X test modify 2 test/00/t0010a.sh
- X test modify 2 test/00/t0011a.sh
- X test modify 2 test/00/t0012a.sh
- X test modify 2 test/00/t0013a.sh
- X test modify 2 test/00/t0014a.sh
- X test modify 2 test/00/t0015a.sh
- X test modify 2 test/00/t0016a.sh
- X test modify 2 test/00/t0017a.sh
- X test modify 2 test/00/t0018a.sh
- X test modify 2 test/00/t0019a.sh
- X test modify 2 test/00/t0020a.sh
- X test modify 2 test/00/t0021a.sh
- X test modify 2 test/00/t0022a.sh
- X test modify 2 test/00/t0023a.sh
- X test modify 2 test/00/t0024a.sh
- X test modify 2 test/00/t0025a.sh
- X test modify 2 test/00/t0026a.sh
- X test modify 2 test/00/t0027a.sh
- X test modify 2 test/00/t0028a.sh
- X test modify 2 test/00/t0029a.sh
- X test modify 2 test/00/t0030a.sh
- X test modify 2 test/00/t0031a.sh
- X test modify 2 test/00/t0032a.sh
- X test modify 2 test/00/t0033a.sh
- X test modify 2 test/00/t0034a.sh
- X test modify 2 test/00/t0035a.sh
- X
- X
- X
- XProject "cook.1.4", Change 3 Page 2
- XChange Details Sat Mar 27 23:14:21 1993
- X
- X Type Action Edit File Name
- X ------- ------- ------- -----------
- X test modify 2 test/00/t0036a.sh
- X test modify 2 test/00/t0037a.sh
- X test modify 2 test/00/t0038a.sh
- X test modify 2 test/00/t0039a.sh
- X test modify 2 test/00/t0040a.sh
- X test modify 2 test/00/t0041a.sh
- X
- XHISTORY
- X What When Who Comment
- X ------ ------ ----- ---------
- X new_change Sat Jan 30 pmiller
- X 21:52:55 1993
- X develop_begin Sat Jan 30 pmiller Elapsed time: 0.122
- X 21:53:03 1993 days.
- X develop_end Sat Jan 30 pmiller
- X 22:48:05 1993
- X review_pass Sat Jan 30 pmiller
- X 22:50:03 1993
- X integrate_begin Sat Jan 30 pmiller
- X 22:50:52 1993
- X integrate_pass Sat Jan 30 pmiller
- X 23:00:48 1993
- X
- X
- X
- XProject "cook.1.4", Change 4 Page 1
- XChange Details Sat Mar 27 23:14:21 1993
- X
- XNAME
- X Project "cook.1.4", Delta 4, Change 4.
- X
- XSUMMARY
- X getenv name conflict
- X
- XDESCRIPTION
- X The name getenv is defined in system includ files, and
- X conflicts with the arguments used in the cook implementation.
- X
- X My thanks to Adam Krolnik <krolnik@magnum.convex.com> for
- X reporting this problem.
- X
- X This change is exempt from testing. This change is exempt from
- X testing against the baseline.
- X
- XCAUSE
- X This change was caused by external_bug.
- X
- XFILES
- X Type Action Edit File Name
- X ------- ------- ------- -----------
- X source modify 3 config
- X source modify 2 cook/env.c
- X source modify 2 cook/env.h
- X source modify 2 cook/stmt.c
- X
- XHISTORY
- X What When Who Comment
- X ------ ------ ----- ---------
- X new_change Thu Feb 18 pmiller
- X 14:53:49 1993
- X develop_begin Thu Feb 18 pmiller Elapsed time: 0.115
- X 14:54:41 1993 days.
- X develop_end Thu Feb 18 pmiller
- X 15:46:37 1993
- X review_pass Thu Feb 18 pmiller
- X 15:46:45 1993
- X integrate_begin Thu Feb 18 pmiller Elapsed time: 0.865
- X 15:47:15 1993 days.
- X integrate_pass Thu Feb 18 pmiller
- X 22:16:39 1993
- X
- X
- X
- XProject "cook.1.4", Change 5 Page 1
- XChange Details Sat Mar 27 23:14:22 1993
- X
- XNAME
- X Project "cook.1.4", Delta 5, Change 5.
- X
- XSUMMARY
- X more convex improvements
- X
- XDESCRIPTION
- X There are some bugs in the Convex include files, and some
- X errors in the source of cook, which prevent it building
- X successfully.
- X
- X My thanks to Adam Krolnik <krolnik@magnum.convex.com> for
- X reporting this problem.
- X
- X This change is exempt from testing. This change is exempt from
- X testing against the baseline.
- X
- XCAUSE
- X This change was caused by external_bug.
- X
- XFILES
- X Type Action Edit File Name
- X ------- ------- ------- -----------
- X source modify 2 aux/BUILDING.man
- X source modify 2 cook/expr.c
- X source modify 2 cook/os.c
- X source modify 2 cooktime/main.c
- X
- XHISTORY
- X What When Who Comment
- X ------ ------ ----- ---------
- X new_change Fri Feb 19 pmiller
- X 16:30:01 1993
- X develop_begin Fri Feb 19 pmiller Elapsed time: 0.155
- X 16:30:16 1993 days.
- X develop_end Fri Feb 19 pmiller Elapsed time: 0.552
- X 17:39:58 1993 days.
- X review_pass Fri Feb 19 pmiller
- X 21:48:33 1993
- X integrate_begin Fri Feb 19 pmiller
- X 21:49:12 1993
- X integrate_pass Fri Feb 19 pmiller
- X 21:57:28 1993
- X
- X
- X
- XProject "cook.1.4", Change 6 Page 1
- XChange Details Sat Mar 27 23:14:23 1993
- X
- XNAME
- X Project "cook.1.4", Delta 6, Change 6.
- X
- XSUMMARY
- X fix copyright notices
- X
- XDESCRIPTION
- X fix copyright notices
- X
- X This change is exempt from testing against the baseline.
- X
- XCAUSE
- X This change was caused by internal_enhancement.
- X
- XFILES
- X Type Action Edit File Name
- X ------- ------- ------- -----------
- X source modify 3 aux/BUILDING.man
- X source modify 2 aux/CHANGES.sh
- X source modify 2 aux/Howto.cook
- X source modify 2 aux/MANIFEST.sh
- X source modify 2 aux/Makefile.awk
- X source modify 2 aux/Makefile.sh
- X source modify 2 aux/README.man
- X source modify 2 aux/patches.sh
- X source modify 2 c_incl/cache.c
- X source modify 2 c_incl/cache.h
- X source modify 2 c_incl/lang_c.c
- X source modify 2 c_incl/lang_roff.c
- X source modify 2 c_incl/main.c
- X source modify 2 c_incl/os.c
- X source modify 2 c_incl/os.h
- X source modify 3 c_incl/sniff.c
- X source modify 2 c_incl/sniff.h
- X source modify 2 common/ansi.c
- X source modify 2 common/arglex.c
- X source modify 2 common/arglex.h
- X source modify 2 common/error.c
- X source modify 2 common/error.h
- X source modify 2 common/help.c
- X source modify 2 common/help.h
- X source modify 2 common/main.h
- X source modify 2 common/mem.c
- X source modify 2 common/mem.h
- X source modify 2 common/s-v-arg.h
- X source modify 2 common/str.c
- X source modify 2 common/str.h
- X source modify 2 common/trace.c
- X source modify 2 common/trace.h
- X source modify 2 common/version.c
- X source modify 2 common/version.h
- X source modify 2 common/word.c
- X source modify 2 common/word.h
- X source modify 2 conf/ConvexOS-10
- X source modify 2 conf/SunOS-4.1.2
- X source modify 2 conf/SunOS-4.1.3
- X source modify 2 conf/SysV-4.0
- X
- X
- X
- XProject "cook.1.4", Change 6 Page 2
- XChange Details Sat Mar 27 23:14:23 1993
- X
- X Type Action Edit File Name
- X ------- ------- ------- -----------
- X source modify 2 conf/dgux-5.4.1
- X source modify 4 config
- X source modify 2 cook/builtin.c
- X source modify 2 cook/builtin.h
- X source modify 2 cook/cook.c
- X source modify 2 cook/cook.h
- X source modify 3 cook/env.c
- X source modify 3 cook/env.h
- X source modify 3 cook/expr.c
- X source modify 2 cook/expr.h
- X source modify 2 cook/glob.c
- X source modify 2 cook/glob.h
- X source modify 2 cook/hashline.h
- X source modify 2 cook/hashline.y
- X source modify 2 cook/id.c
- X source modify 2 cook/id.h
- X source modify 2 cook/lex.c
- X source modify 2 cook/lex.h
- X source modify 2 cook/listing.c
- X source modify 2 cook/listing.h
- X source modify 2 cook/main.c
- X source modify 2 cook/match.c
- X source modify 2 cook/match.h
- X source modify 2 cook/option.c
- X source modify 2 cook/option.h
- X source modify 3 cook/os.c
- X source modify 2 cook/os.h
- X source modify 2 cook/parse.h
- X source modify 2 cook/parse.y
- X source modify 3 cook/stmt.c
- X source modify 2 cook/stmt.h
- X source modify 2 doc/builtin
- X source modify 2 doc/cmdline
- X source modify 2 doc/conditions
- X source modify 2 doc/glossary
- X source modify 2 doc/history
- X source modify 2 doc/how
- X source modify 2 doc/intro
- X source modify 2 doc/intro.aa
- X source modify 2 doc/intro.bb
- X source modify 2 doc/language
- X source modify 2 doc/match
- X source modify 2 doc/option
- X source modify 2 doc/refman.t
- X source modify 2 doc/system
- X source modify 2 doc/variables
- X source modify 2 find_libs/main.c
- X source modify 2 find_libs/os.c
- X source modify 2 find_libs/os.h
- X source modify 2 man1/c_incl.1
- X source modify 2 man1/cook.1
- X source modify 2 man1/cooktime.1
- X source modify 2 man1/find_libs.1
- X source create 1 man1/install.sh
- X source modify 2 man1/roffpp.1
- X
- X
- X
- XProject "cook.1.4", Change 6 Page 3
- XChange Details Sat Mar 27 23:14:23 1993
- X
- X Type Action Edit File Name
- X ------- ------- ------- -----------
- X source modify 2 roffpp/main.c
- X source modify 2 roffpp/preprocess.c
- X source modify 2 roffpp/preprocess.h
- X test modify 3 test/00/t0001a.sh
- X test modify 3 test/00/t0002a.sh
- X test modify 3 test/00/t0003a.sh
- X test modify 3 test/00/t0004a.sh
- X test modify 3 test/00/t0005a.sh
- X test modify 3 test/00/t0006a.sh
- X test modify 3 test/00/t0007a.sh
- X test modify 3 test/00/t0008a.sh
- X test modify 3 test/00/t0009a.sh
- X test modify 3 test/00/t0010a.sh
- X test modify 3 test/00/t0011a.sh
- X test modify 3 test/00/t0012a.sh
- X test modify 3 test/00/t0013a.sh
- X test modify 3 test/00/t0014a.sh
- X test modify 3 test/00/t0015a.sh
- X test modify 3 test/00/t0016a.sh
- X test modify 3 test/00/t0017a.sh
- X test modify 3 test/00/t0018a.sh
- X test modify 3 test/00/t0019a.sh
- X test modify 3 test/00/t0020a.sh
- X test modify 3 test/00/t0021a.sh
- X test modify 3 test/00/t0022a.sh
- X test modify 3 test/00/t0023a.sh
- X test modify 3 test/00/t0024a.sh
- X test modify 3 test/00/t0025a.sh
- X test modify 3 test/00/t0026a.sh
- X test modify 3 test/00/t0027a.sh
- X test modify 3 test/00/t0028a.sh
- X test modify 3 test/00/t0029a.sh
- X test modify 3 test/00/t0030a.sh
- X test modify 3 test/00/t0031a.sh
- X test modify 3 test/00/t0032a.sh
- X test modify 3 test/00/t0033a.sh
- X test modify 3 test/00/t0034a.sh
- X test modify 3 test/00/t0035a.sh
- X test modify 3 test/00/t0036a.sh
- X test modify 3 test/00/t0037a.sh
- X test modify 3 test/00/t0038a.sh
- X test modify 3 test/00/t0039a.sh
- X test modify 3 test/00/t0040a.sh
- X test modify 3 test/00/t0041a.sh
- X
- XHISTORY
- X What When Who Comment
- X ------ ------ ----- ---------
- X new_change Mon Mar 22 pmiller
- X 12:49:07 1993
- X develop_begin Mon Mar 22 pmiller Elapsed time: 0.000
- X 12:49:24 1993 days.
- X develop_end Mon Mar 22 pmiller
- X 21:35:50 1993
- X review_pass Mon Mar 22 pmiller
- X
- X
- X
- XProject "cook.1.4", Change 6 Page 4
- XChange Details Sat Mar 27 23:14:23 1993
- X
- X What When Who Comment
- X ------ ------ ----- ---------
- X 21:35:57 1993
- X integrate_begin Mon Mar 22 pmiller Elapsed time: 0.074
- X 21:36:51 1993 days.
- X integrate_pass Mon Mar 22 pmiller
- X 22:10:07 1993
- X
- X
- X
- XProject "cook.1.4", Change 7 Page 1
- XChange Details Sat Mar 27 23:14:24 1993
- X
- XNAME
- X Project "cook.1.4", Delta 7, Change 7.
- X
- XSUMMARY
- X fix license version
- X
- XDESCRIPTION
- X fix license version
- X
- X This change is exempt from testing against the baseline.
- X
- XCAUSE
- X This change was caused by internal_enhancement.
- X
- XFILES
- X Type Action Edit File Name
- X ------- ------- ------- -----------
- X source remove 1 COPYING
- X source create 1 LICENSE
- X source modify 4 aux/BUILDING.man
- X source modify 3 aux/CHANGES.sh
- X source modify 3 aux/Howto.cook
- X source modify 3 aux/MANIFEST.sh
- X source modify 3 aux/Makefile.awk
- X source modify 3 aux/Makefile.sh
- X source modify 3 aux/README.man
- X source modify 3 aux/patches.sh
- X source modify 3 c_incl/cache.c
- X source modify 3 c_incl/cache.h
- X source modify 3 c_incl/lang_c.c
- X source modify 3 c_incl/lang_roff.c
- X source modify 3 c_incl/main.c
- X source modify 3 c_incl/os.c
- X source modify 3 c_incl/os.h
- X source modify 4 c_incl/sniff.c
- X source modify 3 c_incl/sniff.h
- X source modify 3 common/ansi.c
- X source modify 3 common/arglex.c
- X source modify 3 common/arglex.h
- X source modify 3 common/error.c
- X source modify 3 common/error.h
- X source modify 3 common/help.c
- X source modify 3 common/help.h
- X source modify 3 common/main.h
- X source modify 3 common/mem.c
- X source modify 3 common/mem.h
- X source modify 3 common/s-v-arg.h
- X source modify 3 common/str.c
- X source modify 3 common/str.h
- X source modify 3 common/trace.c
- X source modify 3 common/trace.h
- X source modify 3 common/version.c
- X source modify 3 common/version.h
- X source modify 3 common/word.c
- X source modify 3 common/word.h
- X source modify 3 conf/ConvexOS-10
- X source modify 3 conf/SunOS-4.1.2
- X
- X
- X
- XProject "cook.1.4", Change 7 Page 2
- XChange Details Sat Mar 27 23:14:24 1993
- X
- X Type Action Edit File Name
- X ------- ------- ------- -----------
- X source modify 3 conf/SunOS-4.1.3
- X source modify 3 conf/SysV-4.0
- X source modify 3 conf/dgux-5.4.1
- X source modify 5 config
- X source modify 3 cook/builtin.c
- X source modify 3 cook/builtin.h
- X source modify 3 cook/cook.c
- X source modify 3 cook/cook.h
- X source modify 4 cook/env.c
- X source modify 4 cook/env.h
- X source modify 4 cook/expr.c
- X source modify 3 cook/expr.h
- X source modify 3 cook/glob.c
- X source modify 3 cook/glob.h
- X source modify 3 cook/hashline.h
- X source modify 3 cook/hashline.y
- X source modify 3 cook/id.c
- X source modify 3 cook/id.h
- X source modify 3 cook/lex.c
- X source modify 3 cook/lex.h
- X source modify 3 cook/listing.c
- X source modify 3 cook/listing.h
- X source modify 3 cook/main.c
- X source modify 3 cook/match.c
- X source modify 3 cook/match.h
- X source modify 3 cook/option.c
- X source modify 3 cook/option.h
- X source modify 4 cook/os.c
- X source modify 3 cook/os.h
- X source modify 3 cook/parse.h
- X source modify 3 cook/parse.y
- X source modify 4 cook/stmt.c
- X source modify 3 cook/stmt.h
- X source modify 2 cooktime/date.h
- X source modify 2 cooktime/date.y
- X source modify 3 cooktime/main.c
- X source modify 3 doc/builtin
- X source modify 3 doc/cmdline
- X source modify 3 doc/conditions
- X source modify 3 doc/glossary
- X source modify 3 doc/history
- X source modify 3 doc/how
- X source modify 3 doc/intro
- X source modify 3 doc/intro.aa
- X source modify 3 doc/intro.bb
- X source modify 3 doc/language
- X source modify 3 doc/match
- X source modify 3 doc/option
- X source modify 3 doc/refman.t
- X source modify 3 doc/system
- X source modify 3 doc/variables
- X source modify 3 find_libs/main.c
- X source modify 3 find_libs/os.c
- X source modify 3 find_libs/os.h
- X source modify 3 man1/c_incl.1
- X
- X
- X
- XProject "cook.1.4", Change 7 Page 3
- XChange Details Sat Mar 27 23:14:24 1993
- X
- X Type Action Edit File Name
- X ------- ------- ------- -----------
- X source modify 3 man1/cook.1
- X source modify 3 man1/cooktime.1
- X source modify 3 man1/find_libs.1
- X source modify 2 man1/install.sh
- X source modify 3 man1/roffpp.1
- X source modify 3 roffpp/main.c
- X source modify 3 roffpp/preprocess.c
- X source modify 3 roffpp/preprocess.h
- X test modify 4 test/00/t0001a.sh
- X test modify 4 test/00/t0002a.sh
- X test modify 4 test/00/t0003a.sh
- X test modify 4 test/00/t0004a.sh
- X test modify 4 test/00/t0005a.sh
- X test modify 4 test/00/t0006a.sh
- X test modify 4 test/00/t0007a.sh
- X test modify 4 test/00/t0008a.sh
- X test modify 4 test/00/t0009a.sh
- X test modify 4 test/00/t0010a.sh
- X test modify 4 test/00/t0011a.sh
- X test modify 4 test/00/t0012a.sh
- X test modify 4 test/00/t0013a.sh
- X test modify 4 test/00/t0014a.sh
- X test modify 4 test/00/t0015a.sh
- X test modify 4 test/00/t0016a.sh
- X test modify 4 test/00/t0017a.sh
- X test modify 4 test/00/t0018a.sh
- X test modify 4 test/00/t0019a.sh
- X test modify 4 test/00/t0020a.sh
- X test modify 4 test/00/t0021a.sh
- X test modify 4 test/00/t0022a.sh
- X test modify 4 test/00/t0023a.sh
- X test modify 4 test/00/t0024a.sh
- X test modify 4 test/00/t0025a.sh
- X test modify 4 test/00/t0026a.sh
- X test modify 4 test/00/t0027a.sh
- X test modify 4 test/00/t0028a.sh
- X test modify 4 test/00/t0029a.sh
- X test modify 4 test/00/t0030a.sh
- X test modify 4 test/00/t0031a.sh
- X test modify 4 test/00/t0032a.sh
- X test modify 4 test/00/t0033a.sh
- X test modify 4 test/00/t0034a.sh
- X test modify 4 test/00/t0035a.sh
- X test modify 4 test/00/t0036a.sh
- X test modify 4 test/00/t0037a.sh
- X test modify 4 test/00/t0038a.sh
- X test modify 4 test/00/t0039a.sh
- X test modify 4 test/00/t0040a.sh
- X test modify 4 test/00/t0041a.sh
- X
- XHISTORY
- X What When Who Comment
- X ------ ------ ----- ---------
- X new_change Mon Mar 22 pmiller
- X 22:15:10 1993
- X
- X
- X
- XProject "cook.1.4", Change 7 Page 4
- XChange Details Sat Mar 27 23:14:24 1993
- X
- X What When Who Comment
- X ------ ------ ----- ---------
- X develop_begin Mon Mar 22 pmiller Elapsed time: 0.000
- X 22:15:20 1993 days.
- X develop_end Tue Mar 23 pmiller
- X 09:07:47 1993
- X review_pass Tue Mar 23 pmiller
- X 09:15:14 1993
- X integrate_begin Tue Mar 23 pmiller Elapsed time: 0.086
- X 09:15:53 1993 days.
- X integrate_pass Tue Mar 23 pmiller
- X 09:54:45 1993
- X
- X
- X
- XProject "cook.1.4", Change 8 Page 1
- XChange Details Sat Mar 27 23:14:25 1993
- X
- XNAME
- X Project "cook.1.4", Delta 8, Change 8.
- X
- XSUMMARY
- X use _ty suffix, not _t suffix
- X
- XDESCRIPTION
- X The ANSI C and POSIX standards reserve the _t suffix. The most
- X unlikely collisions have been observed.
- X
- X This change is exempt from testing. This change is exempt from
- X testing against the baseline.
- X
- XCAUSE
- X This change was caused by internal_enhancement.
- X
- XFILES
- X Type Action Edit File Name
- X ------- ------- ------- -----------
- X source modify 4 c_incl/cache.c
- X source modify 4 c_incl/cache.h
- X source modify 4 c_incl/lang_c.c
- X source modify 4 c_incl/lang_roff.c
- X source modify 4 c_incl/main.c
- X source modify 5 c_incl/sniff.c
- X source modify 4 c_incl/sniff.h
- X source modify 4 common/arglex.c
- X source modify 4 common/arglex.h
- X source modify 4 common/error.c
- X source modify 4 common/error.h
- X source modify 4 common/str.c
- X source modify 4 common/str.h
- X source modify 4 common/trace.c
- X source modify 4 common/version.c
- X source modify 4 common/word.c
- X source modify 4 common/word.h
- X source modify 4 cook/builtin.c
- X source modify 4 cook/cook.c
- X source modify 4 cook/cook.h
- X source modify 5 cook/expr.c
- X source modify 4 cook/expr.h
- X source modify 4 cook/glob.c
- X source modify 4 cook/hashline.y
- X source modify 4 cook/id.c
- X source modify 4 cook/id.h
- X source modify 4 cook/lex.c
- X source modify 4 cook/lex.h
- X source modify 4 cook/listing.c
- X source modify 4 cook/main.c
- X source modify 4 cook/match.c
- X source modify 4 cook/match.h
- X source modify 4 cook/option.c
- X source modify 4 cook/option.h
- X source modify 5 cook/os.c
- X source modify 4 cook/os.h
- X source modify 4 cook/parse.h
- X source modify 4 cook/parse.y
- X
- X
- X
- XProject "cook.1.4", Change 8 Page 2
- XChange Details Sat Mar 27 23:14:25 1993
- X
- X Type Action Edit File Name
- X ------- ------- ------- -----------
- X source modify 5 cook/stmt.c
- X source modify 4 cook/stmt.h
- X source modify 4 cooktime/main.c
- X source modify 4 find_libs/main.c
- X source modify 4 roffpp/main.c
- X source modify 4 roffpp/preprocess.c
- X
- XHISTORY
- X What When Who Comment
- X ------ ------ ----- ---------
- X new_change Tue Mar 23 pmiller
- X 12:10:52 1993
- X develop_begin Tue Mar 23 pmiller Elapsed time: 1.090
- X 12:11:04 1993 days.
- X develop_end Wed Mar 24 pmiller
- X 12:51:44 1993
- X review_pass Wed Mar 24 pmiller
- X 12:52:03 1993
- X integrate_begin Wed Mar 24 pmiller Elapsed time: 0.128
- X 12:52:43 1993 days.
- X integrate_pass Wed Mar 24 pmiller
- X 13:50:27 1993
- X
- X
- X
- XProject "cook.1.4", Change 9 Page 1
- XChange Details Sat Mar 27 23:14:27 1993
- X
- XNAME
- X Project "cook.1.4", Delta 9, Change 9.
- X
- XSUMMARY
- X add GNU style long option names
- X
- XDESCRIPTION
- X All command oine option names in cook are long, so this is not
- X very useful. The double '--' is replaced with a single '-'.
- X The --foo=bar syntax is also supported
- X
- X This change is exempt from testing. This change is exempt from
- X testing against the baseline.
- X
- XCAUSE
- X This change was caused by internal_enhancement.
- X
- XFILES
- X Type Action Edit File Name
- X ------- ------- ------- -----------
- X source modify 5 c_incl/main.c
- X source modify 5 common/arglex.c
- X source modify 5 common/arglex.h
- X source modify 4 common/help.c
- X source modify 5 common/version.c
- X source modify 5 cook/main.c
- X source modify 5 cooktime/main.c
- X source modify 5 find_libs/main.c
- X source modify 5 roffpp/main.c
- X
- XHISTORY
- X What When Who Comment
- X ------ ------ ----- ---------
- X new_change Wed Mar 24 pmiller
- X 13:54:14 1993
- X develop_begin Wed Mar 24 pmiller Elapsed time: 0.000
- X 13:54:23 1993 days.
- X develop_end Wed Mar 24 pmiller
- X 22:35:19 1993
- X review_pass Wed Mar 24 pmiller
- X 22:35:26 1993
- X integrate_begin Wed Mar 24 pmiller
- X 22:36:09 1993
- X integrate_pass Wed Mar 24 pmiller
- X 22:45:34 1993
- X
- X
- X
- XProject "cook.1.4", Change 10 Page 1
- XChange Details Sat Mar 27 23:14:32 1993
- X
- XNAME
- X Project "cook.1.4", Delta 10, Change 10.
- X
- XSUMMARY
- X sundry improvements
- X
- XDESCRIPTION
- X Several improvements were made to "polish" the program in
- X preparation for posting another rev.
- X 1. improve the README file
- X 2. improve the BUILDING file
- X 3. improve the tar file
- X 4. Improve the Makefile file
- X
- X This change is exempt from testing. This change is exempt from
- X testing against the baseline.
- X
- XCAUSE
- X This change was caused by internal_enhancement.
- X
- XFILES
- X Type Action Edit File Name
- X ------- ------- ------- -----------
- X source modify 5 aux/BUILDING.man
- X source modify 4 aux/Howto.cook
- X source modify 4 aux/Makefile.sh
- X source modify 4 aux/README.man
- X source modify 6 config
- X
- XHISTORY
- X What When Who Comment
- X ------ ------ ----- ---------
- X new_change Wed Mar 24 pmiller
- X 22:47:28 1993
- X develop_begin Wed Mar 24 pmiller Elapsed time: 0.000
- X 22:47:33 1993 days.
- X develop_end Thu Mar 25 pmiller
- X 10:12:20 1993
- X review_pass Thu Mar 25 pmiller
- X 10:12:26 1993
- X integrate_begin Thu Mar 25 pmiller Elapsed time: 0.094
- X 10:12:56 1993 days.
- X integrate_pass Thu Mar 25 pmiller
- X 10:55:13 1993
- X
- X
- X
- XProject "cook.1.4", Change 11 Page 1
- XChange Details Sat Mar 27 23:14:34 1993
- X
- XNAME
- X Project "cook.1.4", Delta 11, Change 11.
- X
- XSUMMARY
- X ports to more platforms
- X
- XDESCRIPTION
- X Add support for Pyramid, and correct some small problems found
- X while poting.
- X
- X This change is exempt from testing against the baseline.
- X
- XCAUSE
- X This change was caused by internal_enhancement.
- X
- XFILES
- X Type Action Edit File Name
- X ------- ------- ------- -----------
- X source modify 6 aux/BUILDING.man
- X source modify 5 aux/Makefile.sh
- X source modify 4 conf/ConvexOS-10
- X source modify 4 conf/SunOS-4.1.2
- X source modify 4 conf/SunOS-4.1.3
- X source modify 4 conf/SysV-4.0
- X source create 1 conf/ULTRIX-4.2
- X source create 1 conf/dcosx
- X source modify 4 conf/dgux-5.4.1
- X source modify 5 cook/glob.c
- X source modify 6 cook/os.c
- X source modify 3 cooktime/date.y
- X test modify 5 test/00/t0041a.sh
- X
- XHISTORY
- X What When Who Comment
- X ------ ------ ----- ---------
- X new_change Thu Mar 25 pmiller
- X 12:05:16 1993
- X develop_begin Thu Mar 25 pmiller Elapsed time: 0.226
- X 12:05:31 1993 days.
- X develop_end Thu Mar 25 pmiller
- X 13:47:26 1993
- X develop_end_ Thu Mar 25 pmiller
- X undo 13:48:50 1993
- X develop_end Thu Mar 25 pmiller
- X 13:50:24 1993
- X review_pass Thu Mar 25 pmiller
- X 13:51:41 1993
- X integrate_begin Thu Mar 25 pmiller Elapsed time: 0.000
- X 13:52:38 1993 days.
- X integrate_pass Thu Mar 25 pmiller
- X 21:49:11 1993
- X
- X
- X
- XProject "cook.1.4", Change 12 Page 1
- XChange Details Sat Mar 27 23:14:37 1993
- X
- XNAME
- X Project "cook.1.4", Delta 12, Change 12.
- X
- XSUMMARY
- X improve the manual pages
- X
- XDESCRIPTION
- X Correct some small problems and make some minor improvements,
- X including:
- X 1. put a better email address in the shar files.
- X 2. have the manual entries explain abbreviations better
- X 3. have the help within the commands reflect the man pages
- X
- X This change is exempt from testing. This change is exempt from
- X testing against the baseline.
- X
- XCAUSE
- X This change was caused by internal_enhancement.
- X
- XFILES
- X Type Action Edit File Name
- X ------- ------- ------- -----------
- X source modify 5 aux/Howto.cook
- X source modify 6 c_incl/main.c
- X source modify 7 config
- X source modify 6 cook/main.c
- X source modify 6 cooktime/main.c
- X source modify 6 find_libs/main.c
- X source modify 4 man1/c_incl.1
- X source modify 4 man1/cook.1
- X source modify 4 man1/cooktime.1
- X source create 1 man1/copyright.so
- X source modify 4 man1/find_libs.1
- X source modify 3 man1/install.sh
- X source create 1 man1/o__rules.so
- X source modify 4 man1/roffpp.1
- X source modify 6 roffpp/main.c
- X
- XHISTORY
- X What When Who Comment
- X ------ ------ ----- ---------
- X new_change Thu Mar 25 pmiller
- X 21:51:15 1993
- X develop_begin Thu Mar 25 pmiller Elapsed time: 1.115
- X 21:51:19 1993 days.
- X develop_end Fri Mar 26 pmiller
- X 22:42:58 1993
- X review_pass Fri Mar 26 pmiller
- X 22:43:05 1993
- X integrate_begin Fri Mar 26 pmiller Elapsed time: 0.061
- X 22:43:40 1993 days.
- X integrate_pass Fri Mar 26 pmiller
- X 23:11:17 1993
- X
- X
- X
- XProject "cook.1.4", Change 13 Page 1
- XChange Details Sat Mar 27 23:14:39 1993
- X
- XNAME
- X Project "cook.1.4", Delta 13, Change 13.
- X
- XSUMMARY
- X note ConvexOS as a known port
- X
- XDESCRIPTION
- X Checks that ConvexOS works, note comments in Makefile
- X
- X This change is exempt from testing. This change is exempt from
- X testing against the baseline.
- X
- XCAUSE
- X This change was caused by internal_enhancement.
- X
- XSTATE
- X This change is in 'being_integrated' state.
- X
- XFILES
- X Type Action Edit File Name
- X ------- ------- ------- -----------
- X source modify 6 aux/BUILDING.man
- X source modify 5 aux/Makefile.sh
- X source modify 4 aux/README.man
- X
- XHISTORY
- X What When Who Comment
- X ------ ------ ----- ---------
- X new_change Fri Mar 26 pmiller
- X 23:22:24 1993
- X develop_begin Fri Mar 26 pmiller Elapsed time: 0.962
- X 23:22:33 1993 days.
- X develop_end Sat Mar 27 pmiller
- X 23:05:24 1993
- X review_pass Sat Mar 27 pmiller
- X 23:05:34 1993
- X integrate_begin Sat Mar 27 pmiller
- X 23:06:04 1993
- END_OF_FILE
- if test 33082 -ne `wc -c <'CHANGES'`; then
- echo shar: \"'CHANGES'\" unpacked with wrong size!
- fi
- # end of 'CHANGES'
- fi
- if test -f 'cook/cook.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'cook/cook.c'\"
- else
- echo shar: Extracting \"'cook/cook.c'\" \(30507 characters\)
- sed "s/^X//" >'cook/cook.c' <<'END_OF_FILE'
- X/*
- X * cook - file construction tool
- X * Copyright (C) 1990, 1991, 1992, 1993 Peter Miller.
- X * All rights reserved.
- X *
- X * This program is free software; you can redistribute it and/or modify
- X * it under the terms of the GNU General Public License as published by
- X * the Free Software Foundation; either version 2 of the License, or
- X * (at your option) any later version.
- X *
- X * This program is distributed in the hope that it will be useful,
- X * but WITHOUT ANY WARRANTY; without even the implied warranty of
- X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- X * GNU General Public License for more details.
- X *
- X * You should have received a copy of the GNU General Public License
- X * along with this program; if not, write to the Free Software
- X * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- X *
- X * MANIFEST: functions to cook targets
- X *
- X * the kitchen
- X *
- X * This file contains the part of cook that actually decides which
- X * recipes will be cooked.
- X *
- X * When cook has a target, cook performs the following actions in the order
- X * given:
- X *
- X * 1. Cook scans through the instanciated prerequisite recipes. All
- X * prerequisite recipes with the target in their target list are used.
- X *
- X * If the recipe is used, any prerequisite files are recursively
- X * cooked, then if any of the prerequisite files were out of date, then
- X * all other explicit or implicit recipes with the same target will be
- X * deemed to be out of date.
- X *
- X * 2. Cook then scans through the instanciated explicit recipes. All
- X * explicit recipes with the target in their target list are used.
- X *
- X * If the recipe is used, any prerequisite files are recursively
- X * cooked, then if any prerequisites were out of date (including those
- X * of prerequisite recipes) then the actions bound to this recipe will
- X * be evaluated.
- X *
- X * 3. If the target was not the subject of any explicit recipe, cook then
- X * scans the instanciated implicit recipes. Only first implicit recipe
- X * for which cook knows how to cook will be used.
- X *
- X * Implicit recipe targets and prerequisites may contain a wilcard
- X * character (%), which is why they are implicit. If more than one
- X * wildcard character appears, only the last is considered the wilcard
- X * charcater.
- X *
- X * If an implicit recipe is used, when expressions are evaluaded into
- X * word lists, any word containing the wildcard charcater (%) will be
- X * expanded out by the current wildcard expansion.
- X *
- X * 4. If the target is not the subject of any prerequisite or explicit
- X * recipe, and no implicit recipes can be applied, then two things can
- X * happen.
- X * a. If the file exists, then it is up to date, or
- X * b. If the file does not exist then cook doesn't know how.
- X *
- X * If a command in the actions bound to any recipe fail, cook will not
- X * evaluate those actions any further, and will not evaluate the actions
- X * of any recipe for which the target of the failed actions was a
- X * prerequisite.
- X *
- X * Cook will trap recursive looping of targets. If a recursion loop is
- X * detected, then
- X * 1. If the file exists, the it is up to date, or
- X * 2. If the file does not exist then cook doesn't know how.
- X */
- X
- X#include <stddef.h>
- X#include <stdio.h>
- X#include <time.h>
- X#include <signal.h>
- X
- X#include <cook.h>
- X#include <error.h>
- X#include <id.h>
- X#include <main.h>
- X#include <match.h>
- X#include <mem.h>
- X#include <option.h>
- X#include <os.h>
- X#include <trace.h>
- X
- X
- Xrlist explicit; /* the explicit recipes */
- Xrlist implicit; /* the implicit recipes */
- Xstatic int max_tag;
- Xint desist;
- X
- X
- X/*
- X * NAME
- X * interrupt - handle interrupts by signals
- X *
- X * SYNOPSIS
- X * void interrupt(int);
- X *
- X * DESCRIPTION
- X * The interrupt function is used to set the appropriate flags when an
- X * interrupt occurs.
- X *
- X * RETURNS
- X * void
- X *
- X * CAVEAT
- X * Don't use to extravagantly, because it just returns!
- X */
- X
- Xstatic void interrupt _((int));
- X
- Xstatic void
- Xinterrupt(n)
- X int n;
- X{
- X desist++;
- X error("interrupted by %s", signal_name(n));
- X option_set_errors();
- X signal(n, interrupt);
- X}
- X
- X
- X/*
- X * NAME
- X * recipe_tag - make next one
- X *
- X * SYNOPSIS
- X * int recipe_tag(void);
- X *
- X * DESCRIPTION
- X * The recipe_tag function is used to generate successive recipe tages.
- X * Recipe tags are used during the -trace output to indicate which recipe
- X * is in use. Recipes are not necessarily instanciated in the order in
- X * which they appear in the source file, hence the tagging.
- X *
- X * RETURNS
- X * int; unique tag
- X */
- X
- Xint
- Xrecipe_tag()
- X{
- X return ++max_tag;
- X}
- X
- X
- X/*
- X * NAME
- X * cook_status_name - give name of status
- X *
- X * SYNOPSIS
- X * char *cook_status_name(int);
- X *
- X * DESCRIPTION
- X * The cook_status_name function is used to map a cook status name into a
- X * more informative string equivalent of that status.
- X *
- X * RETURNS
- X * char *; pointer to C string.
- X *
- X * CAVEAT
- X * Do not pass the returned string to free().
- X * Do not alter the contents of the string pointed to by the return value.
- X * This function is obly available when synbol DEBUG is defined.
- X * Assumes that the argument will be a valid status value.
- X */
- X
- X#ifdef DEBUG
- X
- Xstatic char *cook_status_name _((int));
- X
- Xstatic char *
- Xcook_status_name(n)
- X int n;
- X{
- X static char *name[] =
- X {
- X "COOK_DONTKNOW",
- X "COOK_ERROR",
- X "COOK_DONE",
- X "COOK_UPTODATE",
- X "COOK_BACKTRACK",
- X };
- X static char buffer[12];
- X
- X if (n >= 0 && n < SIZEOF(name))
- X return name[n];
- X sprintf(buffer, "%d", n);
- X return buffer;
- X}
- X
- X#endif
- X
- Xstatic int cooker _((string_ty *, int, int)); /* forward */
- X
- X
- X/*
- X * NAME
- X * cook_search_list
- X *
- X * SYNOPSIS
- X * cook_search_list(wlist *slp);
- X *
- X * DESCRIPTION
- X * The cook_search_list function is used to get the search list
- X * from the "search_list" variable.
- X *
- X * Defaulting and clean-up are done here, also.
- X * If absent, defaults to ".".
- X * If the first element is not "." then it is inserted.
- X *
- X * ARGUMENTS
- X * slp - where to put the result
- X */
- X
- Xstatic void cook_search_list _((wlist *slp));
- X
- Xstatic void
- Xcook_search_list(slp)
- X wlist *slp;
- X{
- X string_ty *s;
- X
- X /*
- X * make sure the variable exists
- X */
- X trace(("cook_search_list()\n{\n"/*}*/));
- X if (!id_search(id_search_list, ID_CLASS_VARIABLE, slp))
- X {
- X wl_zero(slp);
- X s = str_from_c(".");
- X wl_append(slp, s);
- X str_free(s);
- X id_assign(id_search_list, ID_CLASS_VARIABLE, slp);
- X }
- X
- X /*
- X * make sure the search list isn't empty
- X */
- X if (!slp->wl_nwords)
- X {
- X s = str_from_c(".");
- X wl_append(slp, s);
- X str_free(s);
- X id_assign(id_search_list, ID_CLASS_VARIABLE, slp);
- X }
- X
- X /*
- X * make sure the search list has "." as the first element
- X */
- X if
- X (
- X slp->wl_word[0]->str_text[0] != '.'
- X ||
- X slp->wl_word[0]->str_text[1]
- X )
- X {
- X s = str_from_c(".");
- X wl_prepend(slp, s);
- X str_free(s);
- X id_assign(id_search_list, ID_CLASS_VARIABLE, slp);
- X }
- X trace((/*{*/"}\n"));
- X}
- X
- X
- X/*
- X * NAME
- X * cook_mtime
- X *
- X * SYNOPSIS
- X * long cook_mtime(string_ty *path);
- X *
- X * DESCRIPTION
- X * The cook_mtime function is used to scan the search path for
- X * a file to determine the last-modified time of the file.
- X *
- X * ARGUMENTS
- X * path - file to get the mtime for
- X *
- X * RETURNS
- X * long; -1 on error, 0 if no such file, >0 for time
- X *
- X * CAVEAT
- X * The user must design rules using the [resolve] function.
- X */
- X
- Xstatic long cook_mtime _((string_ty *path));
- X
- Xstatic long
- Xcook_mtime(path)
- X string_ty *path;
- X{
- X long result;
- X
- X trace(("cook_mtime(path = \"%s\")\n{\n"/*}*/, path->str_text));
- X if (path->str_text[0] == '/')
- X result = os_mtime(path);
- X else
- X {
- X wlist sl;
- X long j;
- X
- X result = 0;
- X cook_search_list(&sl);
- X for (j = 0; j < sl.wl_nwords; ++j)
- X {
- X string_ty *s1;
- X string_ty *s2;
- X long t;
- X
- X s1 = sl.wl_word[j];
- X if (s1->str_text[0] == '.' && !s1->str_text[1])
- X s2 = str_copy(path);
- X else
- X s2 = str_format("%S/%S", s1, path);
- X t = os_mtime(s2);
- X str_free(s2);
- X if (t != 0)
- X {
- X result = t;
- X break;
- X }
- X }
- X wl_free(&sl);
- X }
- X trace(("return %ld;\n", result));
- X trace((/*{*/"}\n"));
- X return result;
- X}
- X
- X
- X/*
- X * NAME
- X * cook_mtime_adjust
- X *
- X * SYNOPSIS
- X * int cook_mtime(string_ty *path);
- X *
- X * DESCRIPTION
- X * The cook_mtime_adjust function is used to adjust the mtime of
- X * the first element of the search path catted with the path given.
- X *
- X * ARGUMENTS
- X * path - mtime to adjust
- X *
- X * RETURNS
- X * int; 0 on success, -1 on error
- X *
- X * CAVEAT
- X * The user must design rules using the [resolve] function.
- X */
- X
- Xstatic int cook_mtime_adjust _((string_ty *));
- X
- Xstatic int
- Xcook_mtime_adjust(path)
- X string_ty *path;
- X{
- X int result;
- X
- X /*
- X * the first element is guaranteed to be "."
- X * so we call os_mtime_adjust with path
- X * whether it is absolute or relative.
- X */
- X trace(("cook_mtime_adjust(path = \"%s\")\n{\n"/*}*/, path->str_text));
- X result = os_mtime_adjust(path);
- X trace(("return %d;\n", result));
- X trace((/*{*/"}\n"));
- X return result;
- X}
- X
- X
- X/*
- X * NAME
- X * cook_mtime_resolve
- X *
- X * SYNOPSIS
- X * int cook_mtime_resolve(wlist *output, wlist *input);
- X *
- X * DESCRIPTION
- X * The cook_mtime_resolve function is used to
- X * resolve the name used for a file in the search list.
- X *
- X * It implements the "resolve" built-in function.
- X *
- X * ARGUMENTS
- X * input - the function arguments (0 is the func name)
- X * output - where to put the results
- X *
- X * RETURNS
- X * int; 0 on success, -1 on error
- X *
- X * CAVEAT
- X * The user must design rules using the [resolve] function.
- X */
- X
- Xint
- Xcook_mtime_resolve(output, input)
- X wlist *output;
- X wlist *input;
- X{
- X int result;
- X long j;
- X wlist sl;
- X
- X trace(("cook_mtime_resolve(input = %08lX, output = %08lX)\n{\n"/*}*/,
- X input, output));
- X cook_search_list(&sl);
- X result = 0;
- X for (j = 1; j < input->wl_nwords; ++j)
- X {
- X string_ty *arg;
- X
- X arg = input->wl_word[j];
- X if (arg->str_text[0] == '/')
- X wl_append(output, arg);
- X else
- X {
- X int done;
- X long k;
- X
- X done = 0;
- X for (k = 0; k < sl.wl_nwords; ++k)
- X {
- X string_ty *s1;
- X string_ty *s2;
- X long t;
- X
- X s1 = sl.wl_word[k];
- X if (s1->str_text[0] == '.' && !s1->str_text[1])
- X s2 = str_copy(arg);
- X else
- X s2 = str_format("%S/%S", s1, arg);
- X t = os_mtime(s2);
- X if (t < 0)
- X {
- X result = -1;
- X str_free(s2);
- X break;
- X }
- X if (t > 0)
- X {
- X wl_append(output, s2);
- X str_free(s2);
- X done = 1;
- X break;
- X }
- X str_free(s2);
- X }
- X if (!done)
- X wl_append(output, arg);
- X }
- X if (result < 0)
- X break;
- X }
- X wl_free(&sl);
- X trace(("return %d;\n", result));
- X trace((/*{*/"}\n"));
- X return result;
- X}
- X
- X
- X/*
- X * NAME
- X * chef - the bit that does the cooking
- X *
- X * SYNOPSIS
- X * int chef(string_ty *target, int dkwinge, recipe *rp,
- X * time_ty age, int forced, int build);
- X *
- X * DESCRIPTION
- X * The chef function is used to evaluate a recipe.
- X *
- X * RETURNS
- X * The chef function returns an int; one of the cook status values.
- X *
- X * CAVEAT
- X * The `target' variable is assumed to have already been set.
- X * The match pattern is assumes to have been pushed already.
- X * The recipe flags apply to expression evaluations for ingredients, too.
- X */
- X
- Xstatic int chef _((string_ty *, int, recipe *, time_t, int, int));
- X
- Xstatic int
- Xchef(target, dkwinge, rp, age, forced, build)
- X string_ty *target;
- X int dkwinge;
- X recipe *rp;
- X time_t age;
- X int forced;
- X int build;
- X{
- X int j;
- X int k;
- X int best;
- X char *recipe_type_name;
- X wlist friends;
- X wlist need;
- X wlist younger;
- X match_ty *field;
- X
- X trace(("chef(target = %08lX, dkwinge = %d, rp = %08lX, age = %ld, forced = %d, build = %d)\n{\n"/*}*/, target, dkwinge, rp, age, forced, build));
- X trace_string(target->str_text);
- X wl_zero(&need);
- X wl_zero(&younger);
- X wl_zero(&friends);
- X field = match_top();
- X if (field)
- X {
- X wl_reconstruct(&friends, &rp->r_target, field);
- X recipe_type_name = "implicit";
- X }
- X else
- X {
- X wl_copy(&friends, &rp->r_target);
- X recipe_type_name = "explicit";
- X }
- X id_assign_push(id_friend, ID_CLASS_VARIABLE, &friends);
- X
- X /*
- X * age should be set to the worst case of all the targets
- X */
- X for (j = 0; j < friends.wl_nwords; ++j)
- X {
- X long age2;
- X
- X age2 = cook_mtime(friends.wl_word[j]);
- X if (age2 < 0)
- X {
- X best = COOK_ERROR;
- X goto ret;
- X }
- X if (age2 < age)
- X age = age2;
- X }
- X
- X /*
- X * Flags apply to the precondition and to the ingredients evaluation.
- X * That is why the grammar puts them first.
- X */
- X cook_flags(rp->r_flags, OPTION_LEVEL_RECIPE);
- X
- X /*
- X * wander through the ingredients, seeing if we know how to cook them
- X * the first set is used to determine if to use this recipe
- X * the second set must be cookable
- X */
- X if (!forced)
- X forced = option_test(OPTION_FORCE);
- X best = COOK_UPTODATE;
- X for (j = 0; j < rp->r_need.el_nexprs; ++j)
- X {
- X wlist wl;
- X
- X wl_zero(&wl);
- X if (expr_eval(&wl, rp->r_need.el_expr[j]))
- X {
- X wl_free(&wl);
- X best = COOK_ERROR;
- X goto ret;
- X }
- X for (k = 0; k < wl.wl_nwords; ++k)
- X {
- X string_ty *target2;
- X int best2;
- X
- X target2 = wl.wl_word[k];
- X if (!os_legal_path(target2))
- X {
- X best = COOK_BACKTRACK;
- X wl_free(&wl);
- X goto ret;
- X }
- X wl_append_unique(&need, target2);
- X assert(rp->r_tag <= max_tag);
- X if (option_test(OPTION_TRACE))
- X {
- X error
- X (
- X "\"%s\" %s \"%s\" by %s recipe %d (trace)",
- X target->str_text,
- X (dkwinge ? "requires" : "may require"),
- X target2->str_text,
- X recipe_type_name,
- X rp->r_tag
- X );
- X }
- X option_undo_level(OPTION_LEVEL_RECIPE);
- X best2 = cooker(target2, dkwinge, build);
- X cook_flags(rp->r_flags, OPTION_LEVEL_RECIPE);
- X if (best2 == COOK_DONTKNOW)
- X best2 = COOK_ERROR;
- X if (best2 < best)
- X best = best2;
- X switch (best2)
- X {
- X case COOK_BACKTRACK:
- X best = best2;
- X wl_free(&wl);
- X goto ret;
- X
- X default:
- X if (!option_test(OPTION_PERSEVERE))
- X {
- X wl_free(&wl);
- X goto ret;
- X }
- X break;
- X
- X case COOK_UPTODATE:
- X {
- X time_t mtime;
- X
- X mtime = cook_mtime(target2);
- X if (mtime < 0)
- X {
- X wl_free(&wl);
- X best = COOK_ERROR;
- X goto ret;
- X }
- X if (mtime < age)
- X break;
- X }
- X /* fall through... */
- X
- X case COOK_DONE:
- X forced = 1;
- X wl_append_unique(&younger, target2);
- X break;
- X }
- X }
- X wl_free(&wl);
- X }
- X for (j = 0; j < rp->r_need2.el_nexprs; ++j)
- X {
- X wlist wl;
- X
- X wl_zero(&wl);
- X if (expr_eval(&wl, rp->r_need2.el_expr[j]))
- X {
- X wl_free(&wl);
- X best = COOK_ERROR;
- X goto ret;
- X }
- X for (k = 0; k < wl.wl_nwords; ++k)
- X {
- X string_ty *target2;
- X int best2;
- X
- X target2 = wl.wl_word[k];
- X if (!os_legal_path(target2))
- X {
- X best = COOK_BACKTRACK;
- X wl_free(&wl);
- X goto ret;
- X }
- X wl_append_unique(&need, target2);
- X if (option_test(OPTION_TRACE))
- X {
- X error
- X (
- X "\"%s\" requires \"%s\" by %s recipe %d (trace)",
- X target->str_text,
- X target2->str_text,
- X recipe_type_name,
- X rp->r_tag
- X );
- X }
- X option_undo_level(OPTION_LEVEL_RECIPE);
- X best2 = cooker(target2, 1, build);
- X cook_flags(rp->r_flags, OPTION_LEVEL_RECIPE);
- X if (best2 == COOK_BACKTRACK || best2 == COOK_DONTKNOW)
- X best2 = COOK_ERROR;
- X if (best2 < best)
- X best = best2;
- X switch (best2)
- X {
- X default:
- X if (!option_test(OPTION_PERSEVERE))
- X {
- X wl_free(&wl);
- X goto ret;
- X }
- X break;
- X
- X case COOK_UPTODATE:
- X {
- X time_t mtime;
- X
- X mtime = cook_mtime(target2);
- X if (mtime < 0)
- X {
- X wl_free(&wl);
- X best = COOK_ERROR;
- X goto ret;
- X }
- X if (mtime < age)
- X break;
- X }
- X /* fall through... */
- X
- X case COOK_DONE:
- X forced = 1;
- X wl_append_unique(&younger, target2);
- X break;
- X }
- X }
- X wl_free(&wl);
- X }
- X if (!need.wl_nwords)
- X forced = 1;
- X
- X /*
- X * see if this recipe applies
- X */
- X if (rp->r_precondition)
- X {
- X int result;
- X
- X id_assign_push(id_need, ID_CLASS_VARIABLE, &need);
- X id_assign_push(id_younger, ID_CLASS_VARIABLE, &younger);
- X result = expr_eval_condition(rp->r_precondition);
- X id_delete(id_need, ID_CLASS_VARIABLE);
- X id_delete(id_younger, ID_CLASS_VARIABLE);
- X switch (result)
- X {
- X case -1:
- X best = COOK_ERROR;
- X goto ret;
- X
- X case 0:
- X if (option_test(OPTION_TRACE))
- X {
- X error
- X (
- X "\"%s\" precondition for %s recipe %d rejects (trace)",
- X target->str_text,
- X recipe_type_name,
- X rp->r_tag
- X );
- X }
- X best = COOK_BACKTRACK;
- X goto ret;
- X }
- X }
- X
- X /*
- X * See if we need to perform the actions attached to this recipe.
- X */
- X if (forced && rp->r_action)
- X {
- X if (build)
- X {
- X if (option_test(OPTION_TOUCH))
- X {
- X for (k = 0; k < rp->r_target.wl_nwords; k++)
- X {
- X if (!option_test(OPTION_SILENT))
- X error("touch %s", rp->r_target.wl_word[k]->str_text);
- X if (os_touch(rp->r_target.wl_word[k]))
- X best = COOK_ERROR;
- X else
- X best = COOK_DONE;
- X }
- X }
- X else
- X {
- X int result;
- X
- X id_assign_push(id_need, ID_CLASS_VARIABLE, &need);
- X id_assign_push(id_younger, ID_CLASS_VARIABLE, &younger);
- X result = stmt_eval(rp->r_action);
- X id_delete(id_need, ID_CLASS_VARIABLE);
- X id_delete(id_younger, ID_CLASS_VARIABLE);
- X switch (result)
- X {
- X case STMT_BACKTRACK:
- X best = COOK_DONTKNOW;
- X break;
- X
- X case STMT_OK:
- X best = COOK_DONE;
- X break;
- X
- X case STMT_ERROR:
- X if (option_test(OPTION_ERROK))
- X best = COOK_DONE;
- X else
- X best = COOK_ERROR;
- X break;
- X
- X default:
- X best = COOK_ERROR;
- X break;
- X }
- X if (best == COOK_ERROR && !option_test(OPTION_PRECIOUS))
- X {
- X for (k = 0; k < friends.wl_nwords; k++)
- X os_delete(friends.wl_word[k]);
- X }
- X }
- X }
- X else
- X best = COOK_DONE;
- X }
- X
- X /*
- X * This recipe is being used, so
- X * perform its 'use' action.
- X *
- X * Ignore the 'touch' option,
- X * ignore the 'errok' option,
- X * don't delete files on errors.
- X */
- X if (rp->r_use_action && build)
- X {
- X int result;
- X
- X id_assign_push(id_need, ID_CLASS_VARIABLE, &need);
- X id_assign_push(id_younger, ID_CLASS_VARIABLE, &younger);
- X result = stmt_eval(rp->r_use_action);
- X id_delete(id_need, ID_CLASS_VARIABLE);
- X id_delete(id_younger, ID_CLASS_VARIABLE);
- X if (result != STMT_OK)
- X best = STMT_ERROR;
- X }
- X
- Xret:
- X option_undo_level(OPTION_LEVEL_RECIPE);
- X wl_free(&need);
- X wl_free(&younger);
- X if (best != COOK_BACKTRACK && (build || best != COOK_DONE))
- X {
- X for (j = 0; j < friends.wl_nwords; j++)
- X id_assign(friends.wl_word[j], ID_CLASS_ALREADY, &best);
- X }
- X if (best == COOK_DONE && rp->r_action && build)
- X {
- X /*
- X * update the times if it worked
- X * and if it was not an ingredients recipe
- X */
- X for (j = 0; j < friends.wl_nwords; j++)
- X if (cook_mtime_adjust(friends.wl_word[j]))
- X best = COOK_ERROR;
- X }
- X wl_free(&friends);
- X id_delete(id_friend, ID_CLASS_VARIABLE);
- X trace(("return %s;\n", cook_status_name(best)));
- X trace((/*{*/"}\n"));
- X return best;
- X}
- X
- X
- X/*
- X * NAME
- X * cook - cook a target
- X *
- X * SYNOPSIS
- X * int cooker(string_ty *target, int dkwinge, int build);
- X *
- X * DESCRIPTION
- X * The cooker function is used to find and perform the actions required
- X * to bring the given target up-to-date.
- X *
- X * RETURNS
- X * The cook function returns int; one of the status return values
- X *
- X * COOK_BACKTRACK the given target was not possble, try something else
- X * COOK_UPTODATE the given target required no action
- X * COOK_DONE some action was performed to bring it up to date
- X * COOK_ERROR an error was found when performing some action
- X * COOK_DONTKNOW don't know how to cook the given target
- X */
- X
- Xstatic int cooker _((string_ty *, int, int));
- X
- Xstatic int
- Xcooker(target, dkwinge, build)
- X string_ty *target; /* file which we want to cook */
- X int dkwinge; /* complain if don't know how to */
- X int build; /* build if true, EWOULDBUILD if not */
- X{
- X time_t age; /* age of the target file */
- X int j; /* looping temporary */
- X int best; /* return status */
- X int best2;
- X int outofdate;
- X int used_explicit_recipe;
- X int used_ingredients_recipe;
- X int used_implicit_recipe;
- X wlist target_list;
- X
- X trace(("cooker(target = %08lX, dkwinge = %d, build = %d)\n{\n"/*}*/, target, dkwinge, build));
- X trace_string(target->str_text);
- X wl_zero(&target_list);
- X wl_append(&target_list, target);
- X id_assign_push(id_target, ID_CLASS_VARIABLE, &target_list);
- X wl_free(&target_list);
- X used_ingredients_recipe = 0;
- X used_explicit_recipe = 0;
- X used_implicit_recipe = 0;
- X
- X /*
- X * Check to see if this one has been cooked already.
- X * It may have failed, too. If it is currently being cooked
- X * a value of COOK_BACKTRACK will be returned, this is to
- X * trap recursive recipes.
- X */
- X if (id_search(target, ID_CLASS_ALREADY, &best))
- X {
- X if (best == COOK_BACKTRACK)
- X {
- X error("%s: subject of recipe infinite loop", target->str_text);
- X option_set_errors();
- X best = COOK_ERROR;
- X }
- X goto ret;
- X }
- X
- X /*
- X * add it to the "currently being cooked" list
- X */
- X best = COOK_UPTODATE;
- X age = cook_mtime(target);
- X if (age < 0)
- X {
- X best = COOK_ERROR;
- X goto ret;
- X }
- X best2 = COOK_BACKTRACK;
- X id_assign(target, ID_CLASS_ALREADY, &best2);
- X
- X /*
- X * Look for the named file in the recipes.
- X * If it matches, cook its prerequisites.
- X * It is an explicit recipe if there is any action attached to any recipe
- X * targeting the named file.
- X */
- X outofdate = option_test(OPTION_FORCE);
- X
- X /*
- X * Cook scans through the instanciated ingredients recipes. All
- X * ingredients recipes with the target in their target list are used.
- X *
- X * If the recipe is used, any prerequisite files are recursively
- X * cooked, then if any of the prerequisite files were out of date, then
- X * all other explicit or implicit recipes with the same target will be
- X * deemed to be out of date.
- X */
- X for (j = 0; j < explicit.rl_nrecipes; j++)
- X {
- X if (desist)
- X {
- X best = COOK_ERROR;
- X goto ret;
- X }
- X
- X if
- X (
- X explicit.rl_recipe[j].r_action
- X ||
- X !wl_member(&explicit.rl_recipe[j].r_target, target)
- X )
- X best2 = COOK_BACKTRACK;
- X else
- X {
- X match_push((match_ty *)0);
- X best2 = chef(target, dkwinge, &explicit.rl_recipe[j], age, outofdate, build);
- X match_pop();
- X }
- X if (best2 == COOK_BACKTRACK)
- X continue;
- X used_ingredients_recipe = 1;
- X if (best2 < best)
- X best = best2;
- X if (best2 < COOK_DONE && !option_test(OPTION_PERSEVERE))
- X goto ret;
- X }
- X if (best == COOK_DONE)
- X outofdate = 1;
- X
- X /*
- X * Cook then scans through the instanciated explicit recipes.
- X * Keep looping until a single-colon recipe is met.
- X *
- X * If the recipe is used, any prerequisite files are recursively
- X * cooked, then if any prerequisites were out of date (including those
- X * of prerequisite recipes) then the actions bound to this recipe will
- X * be evaluated.
- X */
- X for (j = 0; j < explicit.rl_nrecipes; j++)
- X {
- X if (desist)
- X {
- X best = COOK_ERROR;
- X goto ret;
- X }
- X
- X if
- X (
- X !explicit.rl_recipe[j].r_action
- X ||
- X !wl_member(&explicit.rl_recipe[j].r_target, target)
- X )
- X best2 = COOK_BACKTRACK;
- X else
- X {
- X match_push((match_ty *)0);
- X best2 = chef(target, dkwinge, &explicit.rl_recipe[j], age, outofdate, build);
- X match_pop();
- X }
- X if (best2 == COOK_BACKTRACK)
- X continue;
- X used_explicit_recipe = 1;
- X if (best2 < best)
- X best = best2;
- X if (best2 < COOK_DONE && !option_test(OPTION_PERSEVERE))
- X goto ret;
- X if (!explicit.rl_recipe[j].r_multiple)
- X goto ret;
- X }
- X if (used_explicit_recipe)
- X goto ret;
- X
- X /*
- X * None of the recipes specified an action,
- X * although prerequisites may have been specified.
- X * Check out the implicit recipes, instead.
- X *
- X * The tricky part is when going through several
- X * layers of recipes. If a cook of a prerequisite comes back
- X * with BACKTRACK, then try something else.
- X *
- X * Only the first applicable implicit recipe is used.
- X */
- X for (j = 0; j < implicit.rl_nrecipes; j++)
- X {
- X match_ty *mbuf;
- X
- X if (desist)
- X {
- X best = COOK_ERROR;
- X goto ret;
- X }
- X
- X mbuf = wl_match(&implicit.rl_recipe[j].r_target, target);
- X if (mbuf)
- X {
- X match_push(mbuf);
- X best2 = chef(target, 0, &implicit.rl_recipe[j], age, outofdate, build);
- X match_pop();
- X match_free(mbuf);
- X }
- X else
- X best2 = COOK_BACKTRACK;
- X if (best2 == COOK_BACKTRACK)
- X continue;
- X used_implicit_recipe = 1;
- X if (best2 < best)
- X best = best2;
- X if (!implicit.rl_recipe[j].r_multiple)
- X goto ret;
- X }
- X if (used_implicit_recipe)
- X goto ret;
- X
- X /*
- X * None of the implicit recipes worked, either
- X * (perhapse none applied)
- X * so we don't know how to make this one.
- X *
- X * If it already exists, it must be up-to-date;
- X * but if it doesn't exist, then we may want to backtrack.
- X */
- X if (age <= 0 && !used_ingredients_recipe)
- X best = (dkwinge ? COOK_DONTKNOW : COOK_BACKTRACK);
- X if (best != COOK_BACKTRACK)
- X id_assign(target, ID_CLASS_ALREADY, &best);
- X
- Xret:
- X if (id_search(target, ID_CLASS_ALREADY, &best2) && best2 == COOK_BACKTRACK)
- X id_delete(target, ID_CLASS_ALREADY);
- X id_delete(id_target, ID_CLASS_VARIABLE);
- X if (option_test(OPTION_TRACE))
- X {
- X static char *name[] =
- X {
- X "don't know how",
- X "error",
- X "done",
- X "up to date",
- X "backtracking",
- X };
- X
- X error("\"%s\" %s (trace)", target->str_text, name[best]);
- X }
- X else
- X {
- X switch (best)
- X {
- X case COOK_DONTKNOW:
- X if (dkwinge)
- X error("%s: don't know how", target->str_text);
- X break;
- X
- X case COOK_ERROR:
- X error("%s: not done because of errors", target->str_text);
- X break;
- X }
- X }
- X trace(("return %s;\n", cook_status_name(best)));
- X trace((/*{*/"}\n"));
- X return best;
- X}
- X
- X
- X/*
- X * NAME
- X * rl_append - append a recipe
- X *
- X * SYNOPSIS
- X * void el_append(rlist *rlp, recipe *rp);
- X *
- X * DESCRIPTION
- X * Rl_append is used to append a recipe to a recipe list.
- X *
- X * CAVEAT
- X * Recipes need to overwrite other recipes with
- X * identical target and prerequisite lists.
- X */
- X
- Xvoid
- Xrl_append(rlp, rp)
- X rlist *rlp;
- X recipe *rp;
- X{
- X trace(("rl_append(rlp = %08lX, rp = %08lX)\n{\n"/*}*/, rlp, rp));
- X assert(rlp);
- X assert(rp);
- X assert(!rlp->rl_nrecipes == !rlp->rl_recipe);
- X assert(rp->r_tag > 0 && rp->r_tag <= max_tag);
- X *(recipe *)enlarge(&rlp->rl_nrecipes, (char**)&rlp->rl_recipe, sizeof(recipe)) = *rp;
- X trace((/*{*/"}\n"));
- X}
- X
- X
- X/*
- X * NAME
- X * cook_flags - set them
- X *
- X * SYNOPSIS
- X * void cook_flags(int mask, option_levelk_ty level);
- X *
- X * DESCRIPTION
- X * The cook_flags function is used to take a flags variable and set the
- X * appropriate options at the given level.
- X *
- X * RETURNS
- X * void
- X *
- X * CAVEAT
- X * Use the option_undo_level function to remove the flag settings.
- X */
- X
- Xvoid
- Xcook_flags(mask, level)
- X int mask;
- X int level;
- X{
- X trace(("cook_flags(mask = 0x%04X, level = %d)\n{\n"/*}*/, mask, level));
- X if (mask & RF_ERROK)
- X option_set(OPTION_ERROK, level, 1);
- X if (mask & RF_ERROK_OFF)
- X option_set(OPTION_ERROK, level, 0);
- X if (mask & RF_FORCE)
- X option_set(OPTION_FORCE, level, 1);
- X if (mask & RF_FORCE_OFF)
- X option_set(OPTION_FORCE, level, 0);
- X if (mask & RF_METER)
- X option_set(OPTION_METER, level, 1);
- X if (mask & RF_METER_OFF)
- X option_set(OPTION_METER, level, 0);
- X if (mask & RF_PRECIOUS)
- X option_set(OPTION_PRECIOUS, level, 1);
- X if (mask & RF_PRECIOUS_OFF)
- X option_set(OPTION_PRECIOUS, level, 0);
- X if (mask & RF_SILENT)
- X option_set(OPTION_SILENT, level, 1);
- X if (mask & RF_SILENT_OFF)
- X option_set(OPTION_SILENT, level, 0);
- X if (mask & RF_CLEARSTAT)
- X option_set(OPTION_INVALIDATE_STAT_CACHE, level, 1);
- X if (mask & RF_CLEARSTAT_OFF)
- X option_set(OPTION_INVALIDATE_STAT_CACHE, level, 0);
- X trace((/*{*/"}\n"));
- X}
- X
- X
- X/*
- X * NAME
- X * cook - construct files
- X *
- X * SYNOPSIS
- X * int cook(wlist *targets);
- X *
- X * DESCRIPTION
- X * The cook function is used to cook the given set of targets.
- X *
- X * RETURNS
- X * The cook function returns 0 if all of the targets cooked sucessfully,
- X * or 1 if there was any problem.
- X *
- X * CAVEAT
- X * This function must be called after evrything has been initialized,
- X * and the cookbook read in.
- X */
- X
- Xint
- Xcook(wlp)
- X wlist *wlp;
- X{
- X int retval;
- X int j;
- X
- X /*
- X * set interrupts to catch
- X *
- X * Note that tee(1) [see listing.c] must ignore them
- X * for the generated messages to appear in the log file.
- X */
- X trace(("cook(wlp = %08lX)\n{\n"/*}*/, wlp));
- X if (signal(SIGINT, SIG_IGN) != SIG_IGN)
- X signal(SIGINT, interrupt);
- X if (signal(SIGHUP, SIG_IGN) != SIG_IGN)
- X signal(SIGHUP, interrupt);
- X if (signal(SIGTERM, SIG_IGN) != SIG_IGN)
- X signal(SIGTERM, interrupt);
- X
- X /*
- X * cook each of the targets
- X */
- X retval = 0;
- X for (j = 0; j < wlp->wl_nwords; j++)
- X {
- X switch (cooker(wlp->wl_word[j], 1, 1))
- X {
- X case COOK_ERROR:
- X case COOK_DONTKNOW:
- X retval = 1;
- X break;
- X
- X case COOK_UPTODATE:
- X error("%s: already up to date", wlp->wl_word[j]->str_text);
- X break;
- X }
- X if (retval > 0 && !option_test(OPTION_PERSEVERE))
- X break;
- X }
- X trace(("return %d;\n", retval));
- X trace((/*{*/"}\n"));
- X return retval;
- X}
- X
- X
- X/*
- X * NAME
- X * isit_uptodate - test construct files
- X *
- X * SYNOPSIS
- X * int isit_uptodate(string_ty *target);
- X *
- X * DESCRIPTION
- X * The isit_uptodate function is used test if the giben target
- X * is up to date.
- X *
- X * RETURNS
- X * The isit_uptodate function returns
- X * -1 if any error is encountered
- X * 0 if not up to date, or don't know how
- X * 1 if target is uptodate.
- X *
- X * CAVEAT
- X * This function must be called after everything has been initialized,
- X * and the cookbook read in.
- X */
- X
- Xint
- Xisit_uptodate(target)
- X string_ty *target;
- X{
- X int retval;
- X
- X /*
- X * set interrupts to catch
- X *
- X * Note that tee(1) [see listing.c] must ignore them
- X * for the generated messages to appear in the log file.
- X */
- X trace(("isit_uptodate(target = %08lX)\n{\n"/*}*/, target));
- X trace_string(target->str_text);
- X if (signal(SIGINT, SIG_IGN) != SIG_IGN)
- X signal(SIGINT, interrupt);
- X if (signal(SIGHUP, SIG_IGN) != SIG_IGN)
- X signal(SIGHUP, interrupt);
- X if (signal(SIGTERM, SIG_IGN) != SIG_IGN)
- X signal(SIGTERM, interrupt);
- X
- X /*
- X * cook the target
- X */
- X switch (cooker(target, 0, 0))
- X {
- X default:
- X retval = -1;
- X break;
- X
- X case COOK_UPTODATE:
- X retval = 1;
- X break;
- X
- X case COOK_DONTKNOW:
- X case COOK_DONE:
- X retval = 0;
- X break;
- X }
- X trace(("return %d;\n", retval));
- X trace((/*{*/"}\n"));
- X return retval;
- X}
- X
- X
- X/*
- X * NAME
- X * cando - test construct files
- X *
- X * SYNOPSIS
- X * int cando(string_ty *target);
- X *
- X * DESCRIPTION
- X * The cando function is used to test if the given target is cookable.
- X *
- X * RETURNS
- X * The cando function returns
- X * -1 if any error was encountered
- X * 0 if can't cook the target
- X * 1 if can cook target
- X *
- X * CAVEAT
- X * This function must be called after everything has been initialized,
- X * and the cookbook read in.
- X */
- X
- Xint
- Xcando(target)
- X string_ty *target;
- X{
- X int retval;
- X
- X /*
- X * set interrupts to catch
- X *
- X * Note that tee(1) [see listing.c] must ignore them
- X * for the generated messages to appear in the log file.
- X */
- X trace(("cando(target = %08lX)\n{\n"/*}*/, target));
- X trace_string(target->str_text);
- X if (signal(SIGINT, SIG_IGN) != SIG_IGN)
- X signal(SIGINT, interrupt);
- X if (signal(SIGHUP, SIG_IGN) != SIG_IGN)
- X signal(SIGHUP, interrupt);
- X if (signal(SIGTERM, SIG_IGN) != SIG_IGN)
- X signal(SIGTERM, interrupt);
- X
- X /*
- X * cook the target
- X */
- X switch (cooker(target, 0, 0))
- X {
- X default:
- X retval = -1;
- X break;
- X
- X case COOK_DONTKNOW:
- X retval = 0;
- X break;
- X
- X case COOK_UPTODATE:
- X case COOK_DONE:
- X retval = 1;
- X break;
- X }
- X trace(("return %d;\n", retval));
- X trace((/*{*/"}\n"));
- X return retval;
- X}
- END_OF_FILE
- if test 30507 -ne `wc -c <'cook/cook.c'`; then
- echo shar: \"'cook/cook.c'\" unpacked with wrong size!
- fi
- # end of 'cook/cook.c'
- fi
- echo shar: End of archive 10 \(of 11\).
- cp /dev/null ark10isdone
- MISSING=""
- for I in 1 2 3 4 5 6 7 8 9 10 11 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 11 archives.
- rm -f ark[1-9]isdone ark[1-9][0-9]isdone
- else
- echo You still need to unpack the following archives:
- echo " " ${MISSING}
- fi
- ## End of shell archive.
- exit 0
-